package com.newblog2_0.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newblog2_0.model.ArticleInfo;
import com.newblog2_0.model.UserInfo;
import com.newblog2_0.model.vo.UserInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:TQ02
 * Data:2023-12-16
 * Time:15:10
 * Text：
 */
@Mapper
public interface UserMapper extends BaseMapper<UserInfo> {
//    查询所有人员信息
    @Select("select * from userinfo")
    List<UserInfo> getUserAll();

//    查询指定人员信息
    @Select("select * from userinfo where uId=#{uId}")
    UserInfoVo getUser(int uId);

    @Update("update userinfo set password=#{password2} where uName=#{uName}")
    int changepd(@Param("uName")String uName, @Param("password2")String password2);

    @Update("update userinfo set photo=#{photo} where uName=#{uName}")
    int changeph(@Param("photo")String photo, @Param("uName")String uName);

}
